package com.yzd.learnjava.typeinfo.pets;

import java.util.ArrayList;
import java.util.List;

public class ForNameCreator extends PetCreator{
	
	private static List<Class<? extends Pet>> types = new ArrayList<Class<? extends Pet>>();
	private static String[] typeNames = {
			"com.yzd.learnjava.typeinfo.pets.Mutt",
			"com.yzd.learnjava.typeinfo.pets.Pug",
			"com.yzd.learnjava.typeinfo.pets.EgyptianMau",
			"com.yzd.learnjava.typeinfo.pets.Manx",
			"com.yzd.learnjava.typeinfo.pets.Cymric",
			"com.yzd.learnjava.typeinfo.pets.Rat",
			"com.yzd.learnjava.typeinfo.pets.Mouse",
			"com.yzd.learnjava.typeinfo.pets.Hamster",
			};
	
	private static void Loader() {
		try {
			for(String name : typeNames) {
				types.add((Class<? extends Pet>)Class.forName(name));
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	static {
		Loader();
	}
	
	public List<Class<? extends Pet>> types(){return types;}

}
